package com.efast.dmom.mgmt.controller.mes.report;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.efast.cafe.framework.bean.ResultBean;
import com.efast.cafe.portal.bean.query.QueryConditionBean;
import com.efast.dmom.mgmt.service.mes.report.ReportVehicleRetrospectService;

@Controller
@RequestMapping("/getInfo")
public class ReportVehicleRetrospectController {
	@Autowired
	private ReportVehicleRetrospectService service;
	//获取整车追溯信息
	@RequestMapping(value="/getInfo")
	public @ResponseBody ResultBean getRetrospectInfo(@RequestBody String json){
		ResultBean result=new ResultBean(true,"'");
	   String jsonString = service.getRetrospectInfo(json);

      JSONObject jsonObj = JSONObject.parseObject(jsonString);
	    result.setObject(jsonObj);
		return result;			
	}
	//获取整车质量信息
	@RequestMapping(value="/getQualityInfo")
	public @ResponseBody ResultBean getQualityInfo(@RequestBody String json){
		ResultBean result=new ResultBean(true,"'");
	   String jsonString = service.getQualityInfo(json);

      JSONObject jsonObj = JSONObject.parseObject(jsonString);
	    result.setObject(jsonObj);
		return result;				
	}
	//获取车辆过点信息
	@RequestMapping(value="/getHistoryInfo")
	public @ResponseBody ResultBean getHistoryInfo(@RequestBody String json){
		ResultBean result=new ResultBean(true,"'");
	   String jsonString = service.getHistoryInfo(json);

      JSONObject jsonObj = JSONObject.parseObject(jsonString);
	    result.setObject(jsonObj);
		return result;				
	}
	//获取车辆维修信息
	@RequestMapping(value="/getRepairInfo")
	public @ResponseBody ResultBean getRepairInfo(@RequestBody String json){
		ResultBean result=new ResultBean(true,"'");
	   String jsonString = service.getRepairInfo(json);

      JSONObject jsonObj = JSONObject.parseObject(jsonString);
	    result.setObject(jsonObj);
		return result;				
	}
	
	//获取滞留车信息
	@RequestMapping(value="/getVehicleCarInformation")
	public @ResponseBody ResultBean getVehicleCarInformation(HttpServletRequest request,HttpServletResponse response,@RequestBody(required = false) QueryConditionBean queryConditionBean) {
		ResultBean result = new ResultBean(true,"'");
		String jsonString = service.getVehicleCarInformation(queryConditionBean);
		JSONObject jsonObj = JSONObject.parseObject(jsonString);
		result.setObject(jsonObj);
		return result;
	}
	
	//获取计划完成率
	@RequestMapping(value="/getPlannedCompletionRate")
	public @ResponseBody ResultBean getPlannedCompletionRate(HttpServletRequest request,HttpServletResponse response,@RequestBody(required = false) QueryConditionBean queryConditionBean) {
		ResultBean result = new ResultBean(true,"'");
		String jsonString = service.getPlannedCompletionRate(queryConditionBean);
		JSONObject jsonObj = JSONObject.parseObject(jsonString);
		result.setObject(jsonObj);
		return result;
	}
	
	//各质量门质量指标 
	@RequestMapping(value="/getEachQualityGateDoorIndex")
	public @ResponseBody ResultBean getEachQualityGateDoorIndex(HttpServletRequest request,HttpServletResponse response,@RequestBody(required = false) QueryConditionBean queryConditionBean) {
		ResultBean result = new ResultBean(true,"'");
		String jsonString = service.getEachQualityGateDoorIndex(queryConditionBean);
		JSONObject jsonObj = JSONObject.parseObject(jsonString);
		result.setObject(jsonObj);
		return result;
	}
}
